This article mainly introduces the method by which PHP obtains the number of days of the month and the date array according to the date, related to the relevant judgment, conversion and the traversal operation of the character and array of PHP, and
This example describes how PHP obtains the number of days and date arrays by month. Share to everyone for your reference, as follows:
function Get_day ($date) { $tem = explode ('-', $date);//Cut date get year and month $year = $tem [' 0 '];
The example of this article is about how to get the last days of month, the maximum days and the number of days. Share to everyone for your reference, specific as follows:
title page
function Getlastday (year,month)
{
var new_year =
title page
function Getlastday (year,month)
{
var new_year = year; Take the current year
var new_month = month++;//Remove the first day of one months to facilitate calculation (last day is not fixed)
if (month>12) //If
Original link: http://www.jb51.net/article/44468.htm
First, get the last day of the month (possibly 28/29/30/21) problem, the idea is simply to get the first day of the next month, the number of milliseconds from 1970, and then subtract the number
#include int main (){int year, month, flag = 0;printf ("Enter Year and month:!\n");scanf ("%d%d", &year, &month);If (year% of 4 ==0 && year%!! = 0 | | Year% 400 ==0){flag = 1;printf ("The year you entered is a leap years \ n");}Else{Flag = 0;printf (
JS Get Current date time + date validation + judgment leap Year + date difference + date formatting +js Judging How many days a certain monthString to date type +js current datetime + date validation + judgment leap Year + date difference + date
Objective
This function is often used in developing iOS, and the one-month interval is the first and last day, and you need to know how many days of the month to know what the last day is, and whether it is a leap year, maybe 28 days in February.
Document directory
Related posts:
Link: http://www.jeffblankenburg.com/2010/09/30/31-days-of-windows-phone-7/
Welcome to the 31 days of Windows Phone. This is a journey through a ton of different topics in development for the Windows Phone
(C syntax) print the number of days in a month, syntax 17
Knowledge point:
Flexible use of logical expressions
Method 1:
Switch () usage, pay attention to the use of case 'A ':......; Break; case 6 :......; Break;
Do not forget break;
Method 2:
If ..
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.